﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;

namespace VersionComparer.DataModel.FileSystem
{
    public class ImageFileItem : FileItem
    {
        public ImageFileItem(Image image , string path)
            : base(path)
        {
            base.Image = image;
            FileImage = image;
        }

        protected override int HashCodeForMatch
        {
            get
            {
                return FileImage.GetHashCode();
            }
        }



        Image FileImage
        {
            get;
            set;
        }


        protected override ComparableItem[] CreateChilds()
        {
            List<ComparableItem> childs = new List<ComparableItem>();
            childs.Add(new ValueItem(this, "Width", FileImage.Width.ToString()));
            childs.Add(new ValueItem(this, "Height", FileImage.Height.ToString()));
            childs.Add(new ValueItem(this, "ImageHash", FileImage.GetHashCode().ToString ()));

            childs.AddRange (base.CreateChilds());
            return childs.ToArray ();
        }
    }
}
